package easymall.clients;

import easymall.po.Category;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("categoryservice")
public interface CategoryService {
    @GetMapping("/getCategorysByPage")
     List<Category> getCategorysByPage(@RequestParam Integer page);

    @GetMapping("/getTotalPage")
     int getTotalPage();

    @GetMapping("/allcategorys")
     List<Category> allcategorys();

    @GetMapping("/getCategorysCount")
     int getCategorysCount();

    @GetMapping("/checkCategorysExist")
     int checkCategorysExist(@RequestParam String name);

    @PostMapping("/updateCategory")
     int updateCategory(@RequestBody Category category);

    @GetMapping("/saveCategory")
     int saveCategory(@RequestParam String name);

    @GetMapping("/delCategory")
     int delCategory(@RequestParam Integer id);
}
